using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Configuration;
using Entity;

namespace AutoGear.BLL
{
    public class CartItem
    {
        private Product _product;
        private int _quantity;
        private double _unitPrice;
        private string _metalType;      // +++ sk 062510
        private string _giftWrapper;        // +++ sk 062510

        public Product Product
        {
            get { return _product; }
            set { _product = value; }
        }

        public int Quantity
        {
            get { return _quantity; }
            set { _quantity = value; }
        }

        public double ItemTotal
        {
            get { return _quantity * UnitPrice; }
        }

        public double UnitPrice
        {
            get { return _unitPrice; }
            set { _unitPrice = value; }
        }

        public string MetalType     // +++ sk 062510
        {
            get { return _metalType; }
            set { _metalType = value; }
        }

        public string GiftWrapper       // +++ sk 062510
        {
            get { return _giftWrapper; }
            set { _giftWrapper = value; }
        }

        public CartItem() { }

        public CartItem(Product Product, int Quantity, string MetalType, string GiftWrapper)
        {
            this._product = Product;
            this._quantity = Quantity;
            this._metalType = MetalType;    // +++ sk 062510
            this._giftWrapper = GiftWrapper;  // +++ sk 062510
            if (Product.StandardCost > 0) 
            {
                this._unitPrice = Product.StandardCost + Product.AdditionalPrice;
            }
            else 
            {
                this._unitPrice = Product.ProductPrice + Product.AdditionalPrice;
            }
            
        }

        public CartItem(Product Product, int Quantity, string MetalType, string GiftWrapper,bool IsPartner)
        {
            this._product = Product;
            this._quantity = Quantity;
            this._metalType = MetalType;    // +++ sk 062510
            this._giftWrapper = GiftWrapper;  // +++ sk 062510
            this._unitPrice = Product.ProductPrice;
        }

        public CartItem(Product Product, int Quantity, double Price, string MetalType, string GiftWrapper)
        {
            this._product = Product;
            this._quantity = Quantity;
            this._metalType = MetalType;    // +++ sk 062510
            this._giftWrapper = GiftWrapper;    // +++ sk 062510
            this.UnitPrice = Price + Product.AdditionalPrice;
        }

        public void Update()
        {
            throw new Exception("The method or operation is not implemented.");
        }
    }
}
